<?php
class Activity_model extends CI_model
{
    protected $db2;
	public function __construct()
    {
        parent::__construct();
        $this->load->helper('http');
    }
    
    /**
 	* 获取首页banner信息列表
 	*根据创建时间倒序排列
 	*/
    public function getActivitysByStatus(){
    	$url = 'https://cherish.fitcome.net/activity/all';
        $res = json_decode(http_get($url),true);
        $data = $res['datas'];
        return $data;
    }
    
    /**
    * 获取所有曾上线的活动
    *根据创建时间倒序排列
    */
    public function getActivitys(){
        $url = 'https://cherish.fitcome.net/activity/valid';
        $res = json_decode(http_get($url),true);
        $data = $res['datas'];
        return $data;
    }
    /**
 	* 根据goods_id获取一条记录
 	*/
    public  function  getActivitysById($id){
        $url = 'https://cherish.fitcome.net/Activity/getActivityById?id='.$id;
        $res = json_decode(http_get($url),true);
        $data = $res['datas'];
        return $data;
    }
}